import React,{Component} from "react";
import{
    HashRouter as Router,
    Switch,
    Route,
    Redirect
}from "react-router-dom"
import loadable from "&/loadable"
const Login = loadable(()=>import("./login"))
export default class MainRouter extends Component{
    render(){
        return(
            
               <Router>
                   <Route component={MyLayout}/>
               </Router>
          
        )
    }
}
class MyLayout extends Component{
    render(){
        return(
            <Switch>
                <Route path="/" exact render={()=>(<Redirect to="/login"/>)}/>
                <Route path="/login" component={Login}/>
                <Route path="/main" component={loadable(()=>import("./main"))}/>

                <Route component={loadable(()=>import("./404"))} />
            </Switch>
            
        )
    }
}